import { createStore } from "redux";
import reducer from "./reducer";
// import {thunk} from "redux-thunk";
import thunk from "./middleware/thunk"
import log from "./middleware/log"
import applyMiddleware from "./middleware/applyMiddleware"
const store = createStore(reducer);
applyMiddleware(store,log,thunk)

// function log(store) {
//     const next = store.dispatch
//     function logAndDispatch(action) {
//         console.log("当前派发的action",action)
//         next(action)
//     }
//     store.dispatch = logAndDispatch
// }
// log(store)


export default store;